//
// Source code recreated from a .class file by IntelliJ IDEA
// (powered by FernFlower decompiler)
//

package SaveServlet.student;

import com.lyq.bean.Student;
import com.lyq.bean.service.S_Service;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;

@WebServlet({"/StudentInfo_Servlet"})
public class StudentInfo_Servlet extends HttpServlet {
    private static final long serialVersionUID = 1L;

    public StudentInfo_Servlet() {
    }

    protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        String id = request.getParameter("id");
        String No = (String)request.getSession().getAttribute("UNAME");
        List<Student> list = new ArrayList();
        list = (new S_Service()).seek_S("学号", "精确查询", No, list);
        Student s = (Student)list.toArray()[0];
        request.getSession().setAttribute("s", s);
        if (id.equals("info")) {
            request.getRequestDispatcher("/jsp/student/s/StudentInfo.jsp").forward(request, response);
        } else if (id.equals("update")) {
            request.getRequestDispatcher("/jsp/student/s/UpdateStudentInfo.jsp").forward(request, response);
        }

    }
}
